package ToYesterday.Day13_TreeNode;

import org.junit.Test;

public class Tree {
    TNode T;

    void init(){
        T = new TNode(2);
        TNode n1 = new TNode(3);
        TNode n2 = new TNode(5);
        TNode n3 = new TNode(6);
        TNode n4 = new TNode(12);
        TNode n5 = new TNode(7);
        T.left = n1;
        T.right = n2;
        n1.left = n3;
        n1.right = n4;
        n2 .right = n5;
    }

    void midllesort(TNode T){
        if (T==null) return;
        midllesort(T.left);
        System.out.println(T.val);
        midllesort(T.right);
    }


    void frontsort(TNode T){
        if (T==null) return;
        System.out.println(T.val);
        frontsort(T.left);
        frontsort(T.right);
    }

    @Test
    public void test(){
        init();
//        midllesort(T);
        frontsort(T);
    }


}
